#ifndef BEHAVIORHANDLER_H
#define BEHAVIORHANDLER_H

/*!
 * \file BehaviorHandler.h
 * \author thomas raynal
 * \version 2.0
 */


#include <boost/asio.hpp>
#include <boost/cstdint.hpp>

/*! \namespace Network
 * 
 * Group client/server related classes. Offer API for handling both server and clients.
 */
namespace Network
{
/*! \class BehaviorHandler
* \brief Interface for the client/server behavior implementation
* Messages model must be specified
*/
template <class RequestMessage, class ResponseMessage>
class BehaviorHandler
{
	public:

		//virtual ~BehaviorHandler(){};
		///*!
		//*  \brief Create a request message (boost::shared_pointer)
		//*
		//*/
		//virtual RequestMessage* NewRequestMessage()=0;
		///*!
		//*  \brief Create a response message (boost::shared_pointer)
		//*
		//*/
		//virtual ResponseMessage* NewResponseMessage()=0;

		//virtual boost::shared_ptr<ResponseMessage> NewResponseSharedPtr()=0;
		//virtual boost::shared_ptr<RequestMessage> NewRequestSharedPtr()=0;

		/*!
		*  \brief Routine for incoming response message handling
		*
		*/
		virtual void HandleResponse (ResponseMessage &response, RequestMessage &request, void* args)=0;
		/*!
		*  \brief Routine for incoming request message handling
		*
		*/
		virtual void HandleRequest (ResponseMessage &response, RequestMessage &request, void* args)=0;
		/*!
		*  \brief Set/Unset the handler's mode (passive/active)
		*
		*/
		virtual void SetKillSwitch(bool isKill)=0;
		/*!
		*  \brief Retrieve the handler mode
		*
		*/
		virtual bool GetKillSwitch()=0;
};
}
#endif BEHAVIORHANDLER_H
